

import 'package:encrypt/encrypt.dart';
import 'package:encrypt/encrypt.dart' as end;
// 解密key CRqnlzYrQ6HFWHyN
class EncryptUtils {
  ///Aes解密
  static String decryptAes(String context) {
  String encryptKey = 'nQRKgKZZGtL83Gii';
  final key = end.Key.fromUtf8(encryptKey);
  final iv = IV.fromUtf8('');

  //设置cbc模式
  final encrypter = Encrypter(AES(key, mode: AESMode.ecb, padding: 'PKCS7'));
  // final encrypter = Encrypter(AES(key));

  //解密
  // print("解密后的结果:" + encrypter.decrypt(Encrypted.fromBase64(context), iv: iv));
  // return encrypter.decrypt(Encrypted.fromBase64(data), iv: iv);
    return encrypter.decrypt(Encrypted.fromBase64(context), iv: iv);
  }
 
}